#coding:utf-8


class Solution:
    ans = '11'

    def dfs(self,current:int,n:int)->None:
        
        if n == 1:
            self.ans = '1'
            return
        elif current >= n-1:
            return
        else:
            i = 0
            tmp = ''
            while True:
                if i == len(self.ans):
                    break
                else:
                    j = i + 1
                    cnt = 1
                    while j<len(self.ans) and self.ans[i] == self.ans[j]:
                        cnt += 1
                        j += 1
                    # cnt = max(cnt,1)
                    tmp += str(cnt) + str(self.ans[i])
                i = j
            self.ans = tmp                        
            self.dfs(current+1,n)


    def countAndSay(self, n: int) -> str:
        self.dfs(1,n)
        return self.ans


if __name__ == '__main__':
    solu = Solution()
    print(solu.countAndSay(2))
